<!DOCTYPE html>
<html>
<!-- Created by GNU Texinfo 7.1.1, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Copyright © 2006-2023 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being "Funding Free Software", the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below).  A copy of the license is included in the section entitled
"GNU Free Documentation License".

(a) The FSF's Front-Cover Text is:

A GNU Manual

(b) The FSF's Back-Cover Text is:

You have freedom to copy and modify this GNU Manual, like GNU
     software.  Copies published by the Free Software Foundation raise
     funds for GNU development. -->
<title>Enabling OpenMP (GNU libgomp)</title>

<meta name="description" content="Enabling OpenMP (GNU libgomp)">
<meta name="keywords" content="Enabling OpenMP (GNU libgomp)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">

<link href="index.html" rel="start" title="Top">
<link href="Library-Index.html" rel="index" title="Library Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html" rel="up" title="Top">
<link href="OpenMP-Implementation-Status.html" rel="next" title="OpenMP Implementation Status">
<style type="text/css">
<!--
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
span:hover a.copiable-link {visibility: visible}
-->
</style>


</head>

<body lang="en">
<div class="chapter-level-extent" id="Enabling-OpenMP">
<div class="nav-panel">
<p>
Next: <a href="OpenMP-Implementation-Status.html" accesskey="n" rel="next">OpenMP Implementation Status</a>, Up: <a href="index.html" accesskey="u" rel="up">Introduction</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Library-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<h2 class="chapter" id="Enabling-OpenMP-1"><span>1 Enabling OpenMP<a class="copiable-link" href="#Enabling-OpenMP-1"> &para;</a></span></h2>

<p>To activate the OpenMP extensions for C/C++ and Fortran, the compile-time 
flag <code class="command">-fopenmp</code> must be specified.  This enables the OpenMP directive
<code class="code">#pragma omp</code> in C/C++ and <code class="code">!$omp</code> directives in free form, 
<code class="code">c$omp</code>, <code class="code">*$omp</code> and <code class="code">!$omp</code> directives in fixed form, 
<code class="code">!$</code> conditional compilation sentinels in free form and <code class="code">c$</code>,
<code class="code">*$</code> and <code class="code">!$</code> sentinels in fixed form, for Fortran.  The flag also
arranges for automatic linking of the OpenMP runtime library 
(<a class="ref" href="Runtime-Library-Routines.html">OpenMP Runtime Library Routines</a>).
</p>
<p>A complete description of all OpenMP directives may be found in the
<a class="uref" href="https://www.openmp.org">OpenMP Application Program Interface</a> manuals.
See also <a class="ref" href="OpenMP-Implementation-Status.html">OpenMP Implementation Status</a>.
</p>


</div>



</body>
</html>
